package com.kingyun.gpsinspection.purificationservice.services.jsm.innerservice.impl.enumItem;/**
 * Created by Administrator on 2017/3/13.
 */

import com.kingyun.gpsinspection.purificationservice.dao.mapper.jsm.EnumItemMapper;
import com.kingyun.gpsinspection.purificationservice.facade.model.jsm.EnumItem;
import com.kingyun.gpsinspection.purificationservice.facade.service.jsm.enumItem.JsmEnumItemService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @Author 卢曼成
 * @Description 枚举接口service实现类
 * @CreateDateTime 2017-03-13 9:43
 **/

public class JsmEnumItemServiceImpl implements JsmEnumItemService {
    @Autowired
    private EnumItemMapper enumItemMapper;

    /**
     * @param record
     * @return
     * @Author 卢曼成
     * @Description 新增
     * @CreateDateTime 2017/3/13 9:40
     */
    @Override
    public int insert(EnumItem record) {
        return enumItemMapper.insert(record);
    }

    /**
     * @param record
     * @return
     * @Author 卢曼成
     * @Description 根据内容不为空添加信息
     * @CreateDateTime 2017/3/13 9:40
     */
    @Override
    public int insertSelective(EnumItem record) {
        return enumItemMapper.insertSelective(record);
    }

    /**
     * @param record
     * @Author 卢曼成
     * @Description 根据条件查询集合
     * @CreateDateTime 2017/3/13 9:40
     **/
    @Override
    public List<EnumItem> selectByList(EnumItem record) {
        return enumItemMapper.selectByList(record);
    }

    /**
     * @param dataTypeId
     * @Author 卢曼成
     * @Description 根据类型ID查询集合
     * @CreateDateTime 2017/3/13 9:40
     **/
    @Override
    public List<EnumItem> selectByDataTypeId(String dataTypeId) {
        EnumItem param = new EnumItem();
        param.setDataTypeId(dataTypeId);
        return enumItemMapper.selectByList(param);
    }

    /**
     * @param enumName
     * @Author 卢曼成
     * @Description 根据enumName名称查询集合
     * @CreateDateTime 2017/3/13 9:40
     **/
    @Override
    public List<EnumItem> selectByDataEnumName(String enumName) {
        EnumItem param = new EnumItem();
        param.setEnumName(enumName);
        return enumItemMapper.selectByList(param);
    }

    /**
     * @param itemId
     * @Author 卢曼成
     * @Description 根据枚举ID查询集合
     * @CreateDateTime 2017/3/13 9:40
     **/
    @Override
    public List<EnumItem> selectByItemId(String itemId) {
        EnumItem param = new EnumItem();
        param.setItemId(itemId);
        return enumItemMapper.selectByList(param);
    }
}
